<?
ob_start();
session_start();
include("../conf/config.php");
include("../conf/database.php");
include("../conf/tools.php");
$selected_members=$_GET["sel"];
$list_id=$_GET["list_id"];
$curTime=getIndianDateTime();
$member_list=explode(",",$selected_members);
$hmode=$_GET["hmode"];


if($hmode==1){  // Add Member to List

	foreach($member_list as $memId){

	$arr_data["inv_status"]=0;
	$arr_data["mem_id"]=$memId;
	$arr_data["list_id"]=$list_id;
	$arr_data["rec_created"]=$curTime;

	//Check the Member is already Invited or Not
	$inInfo=@array_pop(qry_data("select * from bkitc_invite_list_mem where mem_id=$memId and list_id=$list_id"));
	$isInvited=0;
	if($inInfo["mem_id"]==$memId) $isInvited=1;

	if(!$isInvited){
		
		insert_qry("bkitc_invite_list_mem",$arr_data);
	}else{

		
	}


	}

}
if($hmode==2){ 

//Send Invitation to Members

}
?>
